import request from '@renderer/utils/request'

export function queryUserTask(query: object) {
  return request({
    url: '/learnclock/app/task/listTasks',
    method: 'get',
    params: query
  })
}

export function updateUserTaskStatus(id: number) {
  return request({
    url: '/learnclock/app/updateUserTaskStatus?id=' + id,
    method: 'put'
  })
}

export function updateUserTaskProgress(id: number) {
  return request({
    url: '/learnclock/app/updateUserTaskProgress?id=' + id,
    method: 'put'
  })
}

export function queryUserAward(name: string) {
  return request({
    url: '/learnclock/app/award/getAward?name=' + name,
    method: 'get'
  })
}
export function updateUserAwardStatus(id: number) {
  return request({
    url: '/learnclock/app/updateUserAwardStatus?id=' + id,
    method: 'put'
  })
}

export function getUserByName(name: string) {
  return request({
    url: '/learnclock/app/getUserByName?name=' + name,
    method: 'get'
  })
}

export function queryUserTaskTotal(name: string) {
  return request({
    url: '/learnclock/app/queryUserTaskTotal?name=' + name,
    method: 'get'
  })
}
